from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
import os
from PyQt5.Qt import QDialog
from ui.py_ui.ui_form import UiNodeForm
from config.config import Config
from views.set_css import set_css


class NodeFormWindow(QDialog, UiNodeForm):

    def __init__(self):
        super().__init__()
        # 使用ui文件导入定义界面类
        self.setupUi(self)
        # dialog设置qss样式
        self.setWindowIcon(QIcon(os.path.join(Config.svg_path, "weight.svg")))
        set_css(self, os.path.join(Config.static_path, 'form_line_edit.css'))


if __name__ == '__main__':
    app = QApplication([])
    set_css(app, os.path.join(Config.static_path, 'form_line_edit.css'))
    stats = NodeFormWindow()
    # apply_stylesheet(app, theme='dark_teal.xml')
    stats.show()
    app.exec_()
